package com.xuyuan.socket.mycase1;

import org.springframework.stereotype.Component;
import org.springframework.web.socket.TextMessage;
import org.springframework.web.socket.WebSocketSession;

@Component
public class NotificationMessageHandler implements MessageHandler {
    @Override
    public void handleMessage(WebSocketSession session, TextMessage message) throws Exception {
        String payload = message.getPayload();
        System.out.println("Notification message received: " + payload);
        session.sendMessage(new TextMessage("Notification Echo: " + payload));
    }
}